<%--
  Created by IntelliJ IDEA.
  User: kkk
  Date: 2022/10/8
  Time: 9:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery.js"></script>
    <base href="${pageContext.request.contextPath}/">
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <style>
        h2{
            margin-left: 260px;
        }
        tr:first-child{
            background-color: deepskyblue;
        }
        tr:nth-child(odd){
            background-color: powderblue;
        }
        a{
            text-decoration: none;
            color: black;
        }
    </style>
</head>
<body>
<form action="MovieAdd.jsp">
    <h2>电影信息列表</h2>
    <input type="submit" value="添加电影">
</form>
<table border="1">
    <tr>
        <th>电影名称</th>
        <th>电影类型</th>
        <th>价格</th>
        <th>是否推荐</th>
        <th>上映时间</th>
        <th>下映时间</th>
        <th>投票数</th>
    </tr>
    <c:forEach items="${list}" var="movie">
        <tr>
            <td>${movie.movieName}</td>
            <td>${movie.movieType}</td>
            <td>${movie.price}</td>
            <td>${movie.recommend==0?"不推荐":"推荐"}</td>
            <td>${movie.startTime}</td>
            <td>${movie.endTime}</td>
            <td>${movie.votes}</td>
        </tr>
    </c:forEach>
</table>
<p>
    <a href="MovieListServlet?pageNo=0">首页</a>
    <c:if test="${requestScope.pageNo-1>0}"><a href="MovieListServlet?pageNo=${requestScope.pageNo-1}">上一页</a></c:if>
    <c:if test="${requestScope.pageNo<requestScope.pageCount-1}"><a href="MovieListServlet?pageNo=${requestScope.pageNo+1}">下一页</a></c:if>
    <a href="MovieListServlet?pageNo=${requestScope.pageCount-1}">尾页</a>
    <span >
        第${requestScope.pageNo+1}页 ，共${requestScope.pageCount}页，总记录数${requestScope.count}条</span>
</p>
</body>
</html>
